package problema039;

public class IntegerRightTriangles {
	
	static int p = 0;
	static int maxCant = 0;
	
	public static void main(String[] args){
		maxRightTriangles();
		System.out.println(p);
	}
	
	public static void maxRightTriangles(){
		int cant = 0;
		for(int i = 2; i <= 1000; i++){
			for(int b = 2; b < i; b++){
				if(((i * i) - (2 * i * b)) % ((2 * i) - (2 * b)) == 0){
					cant++;
				}
			}
			if(cant > maxCant){
				p = i;
				maxCant = cant;
			}
			cant = 0;
		}
	}
}
